<?php
//$this->renderPartial('_videoshow', array('vid'=>1, 'cr'=>Yii::app()->user->name, 'co'=>'KRISOPRAS', 'ca'=>'CAMERA01', 'vwidth'=>320,'vheight'=>240, 'vinterval'=>2000, 'btnplayisvisible'=>FALSE, 'autoplay'=>TRUE, 'showtimeinfo'=>TRUE));
?>
<script type="text/javascript">
    $(document).ready(function() {
        $.ajax({
            url: "<?php echo Yii::app()->createUrl('/SpecialAjax/GetDataCctv'); ?>",
            data: "username=<?php echo Yii::app()->user->getId(); ?>",
            dataType: "json",
            success: function(data) {
            }
        });
        var imgpos = $('#denah-lantai-1').position();
        var peta = $('#denah-lantai-1');
        $('#cb_camera01').offset({left: imgpos.left + (20 * (peta.width() / 100)), top: imgpos.top + (27 * (peta.height() / 100))});
    });

    $(window).on('resize', function() {
        dynamicCoordinate(20, 27, '#cb_camera01', '#denah-lantai-1');
        //$('#tSize').val($(window).width());
    });


</script>
<br>
<div class="head-content">
    <h1>Today</h1>
    <div class="history">
        <ul>
            <li class="thumb"><a href="show_cctv_1_colloum.html" class="col"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/1-c.png" /></a></li>
            <li class="thumb"><a href="show_cctv_2_colloum.html" class="col"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/2-c.png" /></a></li>
            <li class="thumb"><a href="show_cctv.html" class="col"><img src="<?php echo Yii::app()->theme->baseUrl; ?>/images/4-c.png" /></a></li>
            <li><a href="<?php echo Yii::app()->controller->createUrl('requestvideoplayback/index') ?>">History</a></li>
            <li><a href="">Lihat beberapa ruangan</a></li>
        </ul>
    </div>
</div>


<?php
/* echo '<pre>asdasd';
  echo count($cctvmappvideo[0])/2 .' == '.count($cctvmappvideo). (0/2);
  print_r($cctvmappvideo);
  echo '</pre>'; */
?>
<div class="colloum-wrape">

    <div class="colloum-cctv-denah" id="denahperlantai">
        <h1>Denah </h1>
        <h2>Cabang 1</h2>
        <div class="video">
            <img id="denah-lantai-1" src="<?php echo Yii::app()->theme->baseUrl; ?>/images/denah_sigap.jpg" style="position: relative" alt="Computer Hope">
            <div id ="cb_camera01" style="position:absolute;">
                <input type="checkbox"><b><font size="14" color="red">A</font></b>
            </div>
            <!--input id="cb_camera01" type="checkbox"-->
        </div>
        <!--input type="text" id="tSize"-->

        <label>
            <input type="checkbox" name="1">
            Lantai 1</label>
    </div>
    <div class="colloum-cctv-samping-denah">
        <h1><br></h1>
        <h2>Cabang 1</h2>
        <div class="video">asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>
            asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br>asd<br></div>
        <label>
            <input type="checkbox" name="1">
            Lantai 1</label>
    </div>
</div>

<table style="border-style: solid;border-width: thin;">
    <?php
    $maxcolumn = 2;
    $i = 0;
    ?>
    <?php for ($x = 0; $x < count($cctvmappvideo) / $maxcolumn; $x++) { ?>
        <tr>
            <?php for ($a = 0; $a < $maxcolumn; $a++) { ?>
                <td style="border-left-width: thin;border-left-style: solid;width:  340px;">
                    <div class="colloum-cctv">
                        <?php $this->renderPartial('_videoshow', array('vid' => 2, 'cr' => Yii::app()->user->name, 'co' => isset($cctvmappvideo[$i]) ? $cctvmappvideo[$i]->computername : NULL, 'ca' => isset($cctvmappvideo[$i]) ? $cctvmappvideo[$i]->cameraname : NULL, 'vwidth' => 320, 'vheight' => 240, 'vinterval' => 100, 'btnplayisvisible' => FALSE, 'autoplay' => TRUE, 'showtimeinfo' => FALSE)); ?>
                        <strong>                        
                            <?php //echo '<label style="width:300px"><input type="checkbox" name="1">&nbsp;&nbsp;&nbsp;&nbsp;'.$cctvmappvideo[$i]->companyBranch->companyBranch->companybranchname; ?>, 
                            <?php echo $cctvmappvideo[$i]->cameraName->cameraname . '</label>'; ?>
                        </strong>
                    </div>
                </td>
                <?php
                $i++;
            }
            ?>
        </tr>
    <?php } ?>
</table>
</div>
<div class="form">
</div>
<?php echo date("Y-m-d H:i:s", mktime(date('H'), date('i') + 3, date('s'), date('m'), date('d'), date('Y'))); ?>